package com.mew.slots.core.game.fkymr;

import com.mew.common.rest.bo.GameSession;
import com.mew.slots.core.common.handler.AbstractBetHandler;
import com.mew.slots.core.common.handler.SlotsHandler;
import com.mew.slots.core.common.messge.response.SlotsBonusPlayResponseMessage;
import com.mew.slots.core.common.messge.response.SlotsPlayResponseMessage;
import com.mew.slots.core.common.utils.SlotsGameUtil;
import com.mew.slots.core.common.vo.StrategyGameVO;
import com.mew.slots.core.game.fkymr.roller.FkymrIli;
import com.mew.slots.core.game.fkymr.service.FkymrBonusService;
import com.mew.slots.core.game.fkymr.service.FkymrService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author King.Song
 * @Date 2020/11/9 0009
 **/
@Service
@SlotsHandler(value = "FKYMR")
@Slf4j
public class FkymrHandler extends AbstractBetHandler {

    private FkymrService service=new FkymrService();
    private FkymrBonusService bonusService=new FkymrBonusService();

    @Override
    public void specialCheck(StrategyGameVO gameVO, GameSession userVO) {}

    @Override
    public SlotsPlayResponseMessage play(StrategyGameVO gameVO, GameSession userVO) {

        return service.Ready(gameVO);
    }

    @Override
    public SlotsBonusPlayResponseMessage playBonus(StrategyGameVO gameVO, GameSession userVO) {
        return bonusService.play(gameVO);
    }

    @Override
    public void readRoller() throws Exception{
        FkymrIli.getInstance().init();
    }

    public static void main(String[] args) throws Exception {
        FkymrHandler handler=new FkymrHandler();
        handler.readRoller();
        StrategyGameVO vo = SlotsGameUtil.buildTestStrategyGameVO();
        SlotsPlayResponseMessage res = handler.play(vo, null);
        System.out.println(res);
    }
}
